function [residual, g1, g2] = a15_markups_static(y, x, params)
%
% Status : Computes static model for Dynare
%
% Inputs : 
%   y         [M_.endo_nbr by 1] double    vector of endogenous variables in declaration order
%   x         [M_.exo_nbr by 1] double     vector of exogenous variables in declaration order
%   params    [M_.param_nbr by 1] double   vector of parameter values in declaration order
%
% Outputs:
%   residual  [M_.endo_nbr by 1] double    vector of residuals of the static model equations 
%                                          in order of declaration of the equations
%   g1        [M_.endo_nbr by M_.endo_nbr] double    Jacobian matrix of the static model equations;
%                                                     columns: variables in declaration order
%                                                     rows: equations in order of declaration
%   g2        [M_.endo_nbr by (M_.endo_nbr)^2] double   Hessian matrix of the static model equations;
%                                                       columns: variables in declaration order
%                                                       rows: equations in order of declaration
%
%
% Warning : this file is generated automatically by Dynare
%           from model file (.mod)

residual = zeros( 21, 1);

%
% Model equations
%

T37 = (exp(y(1))^(1-params(11))+params(10)-1)/params(10);
T41 = T37^((params(11)-params(7))/(1-params(11)));
T120 = 1+(params(10)-1)*exp(y(1))^(params(11)-1);
T190 = (exp(y(1))*exp(y(13))*(exp(y(1))*exp(y(13))-1)-exp(y(1))*exp(y(13))*exp(y(1))*exp(y(13)))/((exp(y(1))*exp(y(13))-1)*(exp(y(1))*exp(y(13))-1));
T205 = (exp(y(5))-exp(y(5))*params(14))*getPowerDeriv(exp(y(5))-exp(y(5))*params(14),(-params(8)),1);
residual(1) = y(15);
residual(2) = y(16);
residual(3) = y(18);
lhs =y(14);
rhs =log(params(1))+y(9)-y(9);
residual(4)= lhs-rhs;
lhs =exp(y(2));
rhs =exp(y(1))^(-params(11))*T41;
residual(5)= lhs-rhs;
lhs =exp(y(9));
rhs =(exp(y(5))-exp(y(5))*params(14))^(-params(8))-(exp(y(5))-exp(y(5))*params(14))^(-params(8))*params(1)*params(14);
residual(6)= lhs-rhs;
lhs =params(9)*exp(y(8))^params(2);
rhs =exp(y(9))*exp(y(12));
residual(7)= lhs-rhs;
lhs =exp(y(9));
rhs =exp(y(10))*(1-y(15)-y(16))+y(16)*params(1)*exp(y(10));
residual(8)= lhs-rhs;
lhs =exp(y(10));
rhs =params(1)*(exp(y(9))*exp(y(11))+exp(y(10))*(1-params(3)));
residual(9)= lhs-rhs;
lhs =(1-y(15))*exp(y(7));
rhs =exp(y(6))-(1-params(3))*exp(y(6));
residual(10)= lhs-rhs;
lhs =y(4);
rhs =y(19)+y(6)*params(4)+y(8)*(1-params(4));
residual(11)= lhs-rhs;
lhs =y(11);
rhs =y(4)+(-y(13))+log(params(4))-y(6);
residual(12)= lhs-rhs;
lhs =y(12);
rhs =y(4)+(-y(13))+log(1-params(4))-y(8);
residual(13)= lhs-rhs;
lhs =exp(y(1))*exp(y(13))/(exp(y(1))*exp(y(13))-1);
rhs =params(11)-(params(11)-params(7))/T120;
residual(14)= lhs-rhs;
lhs =exp(y(2))*(exp(y(1))-exp((-y(13))))-(1-exp((-y(13))));
rhs =params(5)*exp(y(14))*exp(y(18)+y(14)+y(3));
residual(15)= lhs-rhs;
lhs =exp(y(3));
rhs =1-exp((-y(13)))-(1-1/params(12))*(params(12)/exp(y(13)))^(1-params(7))+params(5)*exp(y(18)+y(14)+y(3));
residual(16)= lhs-rhs;
lhs =exp(y(5))+exp(y(7))+exp(y(17));
rhs =exp(y(4));
residual(17)= lhs-rhs;
lhs =y(17);
rhs =params(6)+y(20);
residual(18)= lhs-rhs;
lhs =y(19);
rhs =y(19)*params(15)+x(1);
residual(19)= lhs-rhs;
lhs =y(20);
rhs =x(2)+y(20)*params(16)+params(17)*y(21);
residual(20)= lhs-rhs;
lhs =y(21);
rhs =y(20);
residual(21)= lhs-rhs;
if ~isreal(residual)
  residual = real(residual)+imag(residual).^2;
end
if nargout >= 2,
  g1 = zeros(21, 21);

  %
  % Jacobian matrix
  %

  g1(1,15)=1;
  g1(2,16)=1;
  g1(3,18)=1;
  g1(4,14)=1;
  g1(5,1)=(-(T41*exp(y(1))*getPowerDeriv(exp(y(1)),(-params(11)),1)+exp(y(1))^(-params(11))*exp(y(1))*getPowerDeriv(exp(y(1)),1-params(11),1)/params(10)*getPowerDeriv(T37,(params(11)-params(7))/(1-params(11)),1)));
  g1(5,2)=exp(y(2));
  g1(6,5)=(-(T205-params(1)*params(14)*T205));
  g1(6,9)=exp(y(9));
  g1(7,8)=params(9)*exp(y(8))*getPowerDeriv(exp(y(8)),params(2),1);
  g1(7,9)=(-(exp(y(9))*exp(y(12))));
  g1(7,12)=(-(exp(y(9))*exp(y(12))));
  g1(8,9)=exp(y(9));
  g1(8,10)=(-(exp(y(10))*(1-y(15)-y(16))+y(16)*params(1)*exp(y(10))));
  g1(8,15)=exp(y(10));
  g1(8,16)=(-(params(1)*exp(y(10))+(-exp(y(10)))));
  g1(9,9)=(-(params(1)*exp(y(9))*exp(y(11))));
  g1(9,10)=exp(y(10))-params(1)*exp(y(10))*(1-params(3));
  g1(9,11)=(-(params(1)*exp(y(9))*exp(y(11))));
  g1(10,6)=(-(exp(y(6))-(1-params(3))*exp(y(6))));
  g1(10,7)=(1-y(15))*exp(y(7));
  g1(10,15)=(-exp(y(7)));
  g1(11,4)=1;
  g1(11,6)=(-params(4));
  g1(11,8)=(-(1-params(4)));
  g1(11,19)=(-1);
  g1(12,4)=(-1);
  g1(12,6)=1;
  g1(12,11)=1;
  g1(12,13)=1;
  g1(13,4)=(-1);
  g1(13,8)=1;
  g1(13,12)=1;
  g1(13,13)=1;
  g1(14,1)=T190-(-((-((params(11)-params(7))*(params(10)-1)*exp(y(1))*getPowerDeriv(exp(y(1)),params(11)-1,1)))/(T120*T120)));
  g1(14,13)=T190;
  g1(15,1)=exp(y(2))*exp(y(1));
  g1(15,2)=exp(y(2))*(exp(y(1))-exp((-y(13))));
  g1(15,3)=(-(params(5)*exp(y(14))*exp(y(18)+y(14)+y(3))));
  g1(15,13)=exp(y(2))*exp((-y(13)))-exp((-y(13)));
  g1(15,14)=(-(params(5)*exp(y(14))*exp(y(18)+y(14)+y(3))+params(5)*exp(y(14))*exp(y(18)+y(14)+y(3))));
  g1(15,18)=(-(params(5)*exp(y(14))*exp(y(18)+y(14)+y(3))));
  g1(16,3)=exp(y(3))-params(5)*exp(y(18)+y(14)+y(3));
  g1(16,13)=(-(exp((-y(13)))-(1-1/params(12))*(-(exp(y(13))*params(12)))/(exp(y(13))*exp(y(13)))*getPowerDeriv(params(12)/exp(y(13)),1-params(7),1)));
  g1(16,14)=(-(params(5)*exp(y(18)+y(14)+y(3))));
  g1(16,18)=(-(params(5)*exp(y(18)+y(14)+y(3))));
  g1(17,4)=(-exp(y(4)));
  g1(17,5)=exp(y(5));
  g1(17,7)=exp(y(7));
  g1(17,17)=exp(y(17));
  g1(18,17)=1;
  g1(18,20)=(-1);
  g1(19,19)=1-params(15);
  g1(20,20)=1-params(16);
  g1(20,21)=(-params(17));
  g1(21,20)=(-1);
  g1(21,21)=1;
  if ~isreal(g1)
    g1 = real(g1)+2*imag(g1);
  end
end
if nargout >= 3,
  %
  % Hessian matrix
  %

  g2 = sparse([],[],[],21,441);
end
end
